@import url(https://fonts.googleapis.com/css?family=Open+Sans:600,400);

$red: #fa7373;
$blue:#7ba2ff;

html,
body
{
 width: 100%;
 height: 100%;
 display: flex;
 justify-content: center;
 align-items: center;   
}

.frame {
    width: 400px;
    height: 400px;

    background-color: #42A7A1;
    border-radius: 2px;
    box-shadow: 1px 2px 10px rgba(0,0,0,0.3);

    // 设置字体
    font-family: 'Open Sans', Helvetica, sans-serif;
    color: #fff;

    // 平滑字体
    -webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

    // 内容居中
    display: flex;
    justify-content: center;
    align-items: center;
}

.card {
    position: relative;
    width: 280px;
    height: 220px;
    background-color: #fff;
    border-radius: 3px;
    box-shadow: 10px 10px 15px rgba(0,0,0,0.3);
    overflow: hidden;

    .header {
        position: relative;
        width: 100%;
        height: 60px;
        background-color: #f1ba64;
        color:#fff;

        .big {
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            position: absolute;
        }

        .small{
            position: absolute;
            font-size: 11px;
            font-weight: 400;
        }

        .title {
            left:15px;
            top: 12px;
        }

        .data {
            left:15px;
            top: 30px;
        }

        .type {
            right: 15px;
            top: 12px;
        }

        .value {
            right: 15px;
            top: 30px;
        }
    }

    .parameter {
        text-align: right;
        padding: 10px 0 14px 0;
 

        span{
            color: #606060;
            font-size: 9px;
            position: relative;
            line-height: 13px;
            padding: 0 10px 0 25px;
        }

        span::before{
            content: "";
            position: absolute;
            left: 6px;
            top: 6px;
            display: block;
            width: 11px;
            height: 3px;
            border-radius: 2px;
        }

        .red::before{
            background-color: $red;
        }

        .blue::before{
            background-color: $blue;
        }
    }

    .statistic{
        position: relative;
        width: 260px;
        height: 81px;

        margin: 0 auto;

        .line-1{
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background-color: #f2f2f2;
        }

        .line-2{
            @extend .line-1;
            top: 40px;
        }

        .line-3{
            @extend .line-1;
            top:inherit;
            bottom: 0;
        }

        .data {
            svg {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
            }

            polyline {
                fill: none;
                stroke-width: 2;
                stroke-linecap: round;
            }

            &.red polyline{
                stroke: $red;
            }

            &.blue polyline{
                stroke: $blue;
            }

            .tooltip{
                position: absolute;
                // background-color: #42A7A1;
                bottom: 13px;
                left:50%;
                transform: translate3d(-50%, 10px , 0);
                font-size: 11px;
                font-weight: 600;
                line-height: 11px;
                padding: 8px 6px;
                border-radius: 3px;
                visibility: hidden;
                opacity: 0;

                transition: transform .4s ease-out 0s, opacity .4s ease-out 0s;

                &::after{
                    content: "";
                    position: absolute;
                    width: 6px;
                    height: 6px;
                    left: 50%;
                    margin-left: -3px;
                    bottom: -3px;
                    transform: rotate(45deg);
                }
                
            }


            [class^="point-"]{
                position: absolute;
                width: 6px;
                height: 6px;
                border-radius: 50%;
                cursor: pointer;
                z-index: 10;

                &:hover .tooltip{
                    visibility: visible;
                    opacity: 1;
                    transform: translate3d(-50%, 0, 0);
                }
            }

            &.red {
                
                [class^="point-"], .tooltip, .tooltip::after{
                    background-color: $red;
                }

                .point-1 {top:43px;left:7px;}
                .point-2 {top:9px;left:47px;}
                .point-3 {top:20px;left:87px;}
                .point-4 {top:9px;left:127px;}
                .point-5 {top:35px;left:167px;}
                .point-6 {top:45px;left:207px;}
                .point-7 {top:16px;left:247px;}
            }

            &.blue{
                [class^="point-"], .tooltip, .tooltip::after{
                    background-color: $blue;
                }


                .point-1 {top: 58px;left:7px;}
                .point-2 {top: 47px;left:47px;}
                .point-3 {top:62px;left:87px;}
                .point-4 {top:52px;left:127px;}
                .point-5 {top:58px;left:167px;}
                .point-6 {top:71px;left:207px;}
                .point-7 {top:61px;left:247px;}
            }
        }


    }
}